//------------------------------------------------------------------------
// Abstract: Define of class Console
//
// Authoring: XiaoHanxiong
//
// Time: 2013.12.08
//
// Static test:
//
// Version history:
//		Ver_1.0	: 2013.12.08	XiaoHanxiong
//		Ver_1.1 : 2013.12.30	XiaoHanxiong
//		Ver_1.2 : 2014.03.02	XiaoHanxiong
//		Ver_1.3 : 2014.07.25	XiaoHanxiong	Modify as char and wchar_t
//------------------------------------------------------------------------
#ifndef __Library_Console_h_
#define __Library_Console_h_

#include "Stdafx.h"

namespace Library
{
	enum _LIBRARY StdColor
	{
		StdColor_Blue = 1,
		StdColor_Green = 2,
		StdColor_Red = 4,
		StdColor_White = 7
	};

	class _LIBRARY Console
	{
	private:
		// Constructor
		Console();
		// Destructor
		~Console();

	/* Basic I/O on console */
	public:
		// Set console output color
		static void SetColor(StdColor color);
		// Set critical section for console output
		static void SetCriticalSection(bool flag);

	/* Extend I/O on both console and journal */
	public:
		// Initialize journal file and error file
		static bool InitializeA(string log, string error);
		static bool InitializeW(wstring log, wstring error);
		// Output a format string to console with specify color
		static void StdOutA(char* format, ...);
		static void StdOutW(wchar_t* format, ...);
		// Output normal information to console and journal file
		static void PrintfA(char* format, ...);
		static void PrintfW(wchar_t* format, ...);
		// Output error information to console and journal file
		static void ErrorfA(char* format, ...);
		static void ErrorfW(wchar_t* format, ...);

	private:
		// Get current time of system
		static const int StringBufferSize = 128;
	};

}// _Library_

#endif